package com.cn.service.server.ComponentMechanical.Impl;

import com.cn.bean.pojo.ComponentMechanical.AbnormalApplicationMainTable;
import com.cn.bean.pojo.ComponentMechanical.AbnormalApplicationSubTable;
import com.cn.bean.pojo.lbj.ComponentSingleRegistrationTable;
import com.cn.bean.pojo.lbj.SingleParameterItemCurrentDataTable;
import com.cn.mapper.dao.db5.ComponentMechanical.AbnormalApplicationDao;
import com.cn.service.server.ComponentMechanical.AbnormalApplicationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class AbnormalApplicationServiceImpl implements AbnormalApplicationService {
    @Autowired(required = false)
    private AbnormalApplicationDao abnormalApplicationDao;
    @Override
    public List<AbnormalApplicationMainTable> selectAbnormalApplicationMain(AbnormalApplicationMainTable abnormalApplicationMainTable) {
        return abnormalApplicationDao.selectAbnormalApplicationMain(abnormalApplicationMainTable);
    }

    @Override
    public List<ComponentSingleRegistrationTable> selectAbnormalComponent(ComponentSingleRegistrationTable componentSingleRegistrationTable) {
        return abnormalApplicationDao.selectAbnormalComponent(componentSingleRegistrationTable);
    }

    @Override
    public List<AbnormalApplicationSubTable> selectAbnormalApplicationSubTable(int id) {
        return abnormalApplicationDao.selectAbnormalApplicationSubTable(id);
    }

    @Override
    public List<AbnormalApplicationSubTable> selectAbnormalSubTable(AbnormalApplicationSubTable abnormalApplicationSubTable) {
        return abnormalApplicationDao.selectAbnormalSubTable(abnormalApplicationSubTable);
    }

    @Override
    public Integer getAbnormalApplicationMainAutoid() {
        return abnormalApplicationDao.getAbnormalApplicationMainAutoid();
    }

    @Override
    public Integer getAbnormalApplicationSubAutoid() {
        return abnormalApplicationDao.getAbnormalApplicationSubAutoid();
    }

    @Override
    public List<SingleParameterItemCurrentDataTable> selectCurrentData(SingleParameterItemCurrentDataTable singleParameterItemCurrentDataTable) {
        return abnormalApplicationDao.selectCurrentData(singleParameterItemCurrentDataTable);
    }

    @Override
    public int insertAbnormalApplicationMain(AbnormalApplicationMainTable abnormalApplicationMainTable) {
        Boolean a=abnormalApplicationDao.insertAbnormalApplicationMain(abnormalApplicationMainTable);
        if(a){
            return 1;
        }
        return 0;
    }

    @Override
    public int insertAbnormalApplicationSub(AbnormalApplicationSubTable abnormalApplicationSubTable) {
        Boolean b=abnormalApplicationDao.insertAbnormalApplicationSub(abnormalApplicationSubTable);
        if(b){
            return 1;
        }
        return 0;
    }

    @Override
    public int updateAbnormal(String uniqueCode) {
        Boolean c=abnormalApplicationDao.updateAbnormal(uniqueCode);
        if(c){
            return 1;
        }
        return 0;
    }

    @Override
    public int lockAbnormal(ComponentSingleRegistrationTable componentSingleRegistrationTable) {
        Boolean d=abnormalApplicationDao.lockAbnormal(componentSingleRegistrationTable);
        if(d){
            return 1;
        }
        return 0;
    }

    @Override
    public int updateAbnormalData(AbnormalApplicationMainTable abnormalApplicationMainTable) {
        Boolean e=abnormalApplicationDao.updateAbnormalData(abnormalApplicationMainTable);
        if(e){
            return 1;
        }
        return 0;
    }

    @Override
    public int delAbnormalSub(int id) {
        Boolean f=abnormalApplicationDao.delAbnormalSub(id);
        if(f){
            return 1;
        }
        return 0;
    }

    @Override
    public int updateAbnormalAudit(int id) {
        Boolean g=abnormalApplicationDao.updateAbnormalAudit(id);
        if(g){
            return 1;
        }
        return 0;
    }

    @Override
    public int updateAbnormalStatus(ComponentSingleRegistrationTable componentSingleRegistrationTable) {
        Boolean h=abnormalApplicationDao.updateAbnormalStatus(componentSingleRegistrationTable);
        if(h){
            return 1;
        }
        return 0;
    }
}
